Skip to content

Conversation

forest000014
Copy link
Contributor

@forest000014 forest000014 commented Dec 28, 2024

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@forest000014 forest000014 self-assigned this Dec 28, 2024
@forest000014 forest000014 requested a review from a team as a code owner December 28, 2024 16:12
@github-actions github-actions bot added the java label Dec 28, 2024
Comment on lines 15 to 22
while (true) {
if (list1 == null) {
curr.next = list2;
break;
} else if (list2 == null) {
curr.next = list1;
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while(true) 대신에 while(list1 != null && list2 != null) 을 조건문으로 사용하고 내부 if ~ else를 while문이 끝난 후에 사용하는 방법도 있을것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하... 그렇게 하는 게 좀 더 논리가 명확하겠네요!
사실 처음부터 while(true)로 짰던 것은 아니고, 최대한 불필요한 조건문을 줄이고 줄이다 보니 지금 코드가 나오게 되었는데요,
코드를 다시 읽어보니 이 조건문이 언제 종료가 되는 것인지, 항상 종료가 되긴 하는 것인지가 한 눈에 직관적으로 이해되지는 않을 수 있겠네요
제안해 주신 아이디어대로 수정해보겠습니다 😄

@forest000014
Copy link
Contributor Author

@TonyKim9401 안녕하세요! 못 풀었던 문제까지 마저 풀어서 리뷰 요청드렸습니다 :) 시간 되실 때 한번 검토 부탁드립니다 🙇

ListNode head = new ListNode();
ListNode curr = head;

while (list1 != null && list2 != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 리뷰 반영해주셔서 감사합니다!

Copy link
Contributor

@SamTheKorean SamTheKorean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번 주 다섯문제나 푸시느라 고생많으셨습니다!

@SamTheKorean SamTheKorean merged commit 4acfa7b into DaleStudy:main Jan 5, 2025
1 check passed
@forest000014 forest000014 changed the title [forest000014] Week 4 [forest000014] Week 04 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

3 participants